import { request } from "./base";
interface LoginResponse {
  token: string;
  expireTime: number;
}
/**
 *  登录
 * @param username 账户
 * @param password 密码
 */
export function login(username: string, password: string,fingerprint?:string) {
  return request<LoginResponse>({
    url: "/signin",
    method: "POST",
    data: {
      username,
      password,
      fingerprint
    },
  });
}
export function loginByFinger(fingerprint: string) {
  return request<LoginResponse>({
    url: "/signinByFinger",
    method: "POST",
    data: {
      fingerprint,
    },
  });
}
export function checkAuth() {
  return request<true>({
    url: "/checkAuth",
    method: "GET",
  });
}